import { createSlice } from "@reduxjs/toolkit";
const citySlice=createSlice({
    name:'cityer',
    initialState:{
        city:'武汉'
    },
    reducers:{
        changeCity:(state,action)=>{
            state.city=action.payload
            localStorage.setItem('nowCity',state.city)
        }
    }
})
export const selectCity = state=>state.cityer.city;
export const {changeCity} = citySlice.actions
export default citySlice.reducer